package com.tang.wx.enums;

public enum WxMsgTypeEnum {
    SUBSCRIBE("event.subscribe", "用户关注事件"),
    TEXT_MSG("text", "接收用户文本消息事件");
    private final String msgType;
    private final String desc;

    public String getMsgType() {
        return msgType;
    }

    public String getDesc() {
        return desc;
    }

    WxMsgTypeEnum(String msgType, String desc) {
        this.msgType = msgType;
        this.desc = desc;
    }

    public static WxMsgTypeEnum getByMsgType(String msgType) {
        for (WxMsgTypeEnum msgTypeEnum : WxMsgTypeEnum.values()) {
            if (msgTypeEnum.msgType.equals(msgType)) {
                return msgTypeEnum;
            }
        }
        return null;
    }
}
